package com.ecommerce.dal.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ecommerce.dal.dao.impl.CommunicationDAO;
import com.ecommerce.dal.entity.Communication;
import com.ecommerce.dal.service.ICommunicationManagerService;


@Service("communicationManagerService")
public class CommunicationManagerService implements
		ICommunicationManagerService {

	@Autowired
	CommunicationDAO communicationDAO;
	@Override
	public Communication retrieveCommunication(int communicationId) {
		return communicationDAO.findByCommunicationId(communicationId);
	}

	@Override
	public void saveCommunication(Communication communication) {
		communicationDAO.save(communication);
		
	}

	@Override
	public List<Communication> retrieveAllCommunications() {
		return communicationDAO.findAllCommunications();
	}

	

	@Override
	public void updateCommunication(Communication communication) {
		communicationDAO.update(communication);
		
	}

	@Override
	public void deleteCommunication(Communication communication) {
		communicationDAO.delete(communication);
		
	}


}
